/*************************************************************************
	> File Name: stdin2stdout.c
	> Author: KyleShaw
	> Mail: xtk621@gmail.com 
	> Created Time: 2014-11-27 22:02:38
 ************************************************************************/

#include <stdio.h>
#include <apue.h>

int main(void)
{
	int input;
	while((input = getc(stdin)) != EOF) {
		if((putc(input, stdout)) == EOF ) {
			err_sys("output error");
		}
	}

	if (ferror(stdin)) {
		err_sys("input error");
	} else {
		printf("nothing error\n");
	}
	exit(0);	
}
